/*
 */
package aptech.eproject.logictics.dao.kien;

import aptech.eproject.logictics.db.Delivery;
import aptech.eproject.logictics.db.Package;
import java.sql.Timestamp;
import java.util.List;
import javax.ejb.Remote;
import javax.ejb.Timeout;
import javax.ejb.Timer;

/**
 *
 * @author Kien Nguyen <solidfoxrock at gmail.com>
 */
@Remote
public interface BookingManagementServiceRemote {

    List<Delivery> findAllBookings();

    List<Delivery> findBookings(int branchId);

    Delivery findBooking(int deliveryId, int branchId);

    void accept(int deliveryId);

    void reject(int deliveryId);

    void confirm(int deliveryId);

    void cancel(int deliveryId);

    void pickUp(int deliveryId);

    List<Double> getDetailRates(Delivery d);

    double calculateTotalRate(Delivery d);

    double findShortestDistance(int startBranchId, int destBranchId);

    double calculateCommission(Delivery d);

    void startAgent();

    void stopAgent();

    @Timeout
    void agentCallBack(Timer timer);

    void checkBookings();

    int createBooking(String username, int startBranchId, int destBranchId,
            String pickUpAddress, String consigneeName, String consigneeAddress,
            Timestamp pickUpDate, List<Package> packages);

    void saveCreditCardNumber(int deliveryId, String ccNum);
}
